<?php

namespace app\index\model;

use think\Model;

class Banner extends Model
{
    //轮播图
    protected $table = 'sn_banner';

    protected function getStatusAttr($value)
    {
        $status = [1 => '启用',2 => '禁用'];
        return $status[$value];
    }

    protected function getTypeAttr($value)
    {
        $status = [1 => 'web', 2 => 'app'];
        return $status[$value];
    }

    /** 轮播图
     * @param $map
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function query_list($map)
    {
        return $this->where($map)->paginate();
    }
}